<template>
  <view class="select-car select-com">
    <!-- 顶，标题 -->
    <view class="select-car__t">
      <view class="select-car__t--title">{{ title }} </view>
      <uni-icons type="closeempty" size="20" @click="$emit('close')"></uni-icons>
    </view>
    <view class="select-car__d">
      <!-- item -->
      <view class="select-com__item" v-for='item in list' :key='item.id' @click="$emit('select', item[label])">
        <view class="item"> {{ item[label] }}</view>
        <view class="item">
          <view v-if="distance"> 距离: {{ item.distance }}km</view>
        </view>
        <view class="item-r">
          <uni-icons v-if="item[label] === value" type="checkbox-filled" size="20"></uni-icons>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: "PopupItemTest",
  props: {
    list: {
      type: Array,
      default() {
        return []
      }
    },
    value: String,
    title: String,
    label: String,
    distance: Boolean
  }
};
</script>

<style lang="scss" scoped>
@import '@/styles/testDrivePopup.scss';
</style>
